<?php

declare(strict_types=1);

namespace app\model;

use app\BaseModel;
use think\model\concern\SoftDelete;

class Prod extends BaseModel
{
    use SoftDelete;

    protected $name = 'prod';

    protected $autoWriteTimestamp = 'datetime';

    protected $json = ['gallery', 'videos', 'attachments', 'attributes'];

    public function category()
    {
        return $this->belongsTo(ProdCategory::class, 'category_id');
    }

    public function brand()
    {
        return $this->belongsTo(ProdBrand::class, 'brand_id');
    }

    public function sellerOrg()
    {
        return $this->belongsTo(Org::class, 'seller_org_id');
    }

    public function region()
    {
        return $this->belongsTo(Region::class, 'region_id');
    }

}
